﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>患者就诊信息</title>
    <link rel="stylesheet" href="../source/layui/css/layui.css">
    <link rel="stylesheet" href="../source/layui_exts/mouseRightMenu.css">
    <link rel="stylesheet" href="../source/css/primary.css">
    <script src="../source/jquery/dist/jquery.js"></script>
    <script src="../source/js/common_url.js"></script>
    <script src="../source/js/util.js"></script>
    <script src="../source/layui/layui.all.js"></script>
    <script src="../source/js/nprogress.js"></script>
    <script src="./js/common_data.js"></script>
    <script src="./js/index.style.js"></script>
    <script src="./js/index.js"></script>
    <script src="./js/patient_tmt_info.js"></script>
    <script src="./js/action.js"></script>
    <script src="./js/primary.js"></script>
</head>

<body class="theme-blue" style="padding: 15px">
  <div class="mui-body">
    <div class="mui-header">
      <ul id="nurse_tabs" class="clearfix mui-tabs">
        <li class="active">候诊</li>
        <li>复诊</li>
        <li>已就诊</li>
        <li>未报到</li>
      </ul>
      <div class="mui-btns">
        <button onclick="xcbdAct()" class="layui-btn ">报到</button>
        <button onclick="addPatinet()" class="layui-btn">录入</button>
        <button onclick="modPatinet()" class="layui-btn">编辑</button>
        <button onclick="voiceBroadcast()" class="layui-btn">广播</button>
        <div  id="intercom" class="layui-input-inline">
            <i id="notDisturb" class="notDisturb">勿扰</i>
            <button onclick="openCalling()" class="layui-btn">对讲</button>
        </div>

        <button onclick="findOne()" class="layui-btn">找人</button>
        <button onclick="refreshTab()" class="layui-btn mui-refreshs">刷新</button>
      </div>
    </div>
    <div class="mui-content">
      <div class="btn-tools clearfix">
        <div class="mui-fl">
          <button id="btn_moveUp" onclick="movePatient('up')" class="layui-btn layui-btn-disabled mui-icon-sy">上移</button>
          <button id="btn_moveDown" onclick="movePatient('down')" class="layui-btn layui-btn-disabled mui-icon-xy">下移</button>
          <button id="btn_toFirst" onclick="yxcz()" class="layui-btn layui-btn-disabled mui-icon-yx">优先</button>
        </div>
        <div class="mui-fr">
          <button onclick="zzcz()" id="btn_zzcz" class="layui-btn layui-btn-disabled mui-icon-zz">转诊</button>
          <button id="btn_fzcz" class="layui-btn layui-btn-disabled mui-icon-fz">分诊</button>
          <button onclick="gqcz()" id="btn_gqcz" class="layui-btn layui-btn-disabled mui-icon-gq">挂起</button>
          <button onclick="yscz()" id="btn_yscz" class="layui-btn layui-btn-disabled mui-icon-ys">延时</button>
          <button onclick="lstd()" id="btn_lstd" class="layui-btn layui-btn-disabled mui-icon-lstd">绿色通道</button>
          <button onclick="zhcz()" id="btn_zhcz" class="layui-btn layui-btn-disabled mui-icon-zh">过号召回</button>
        </div>
      </div>
      <!--<p>&nbsp;</p>-->
      <div class="tab-table">
          <div id="waitTab" class="tab-item mui-show">
              <div class="tab-header">
                  <ul class="clearfix">
                      <li></li>
                      <li>序号</li>
                      <li>就诊号</li>
                      <li>姓名</li>
                      <li>医生</li>
                      <li>就诊状态</li>
                      <li>午别</li>
                      <li>报到时间</li>
                      <li>备注</li>
                  </ul>
              </div>
              <div id="waitList" class="tab-body">
                  <!--<ul class="clearfix status-0">
                      <li><input name='sel_radio' type="radio"></li>
                      <li>1</li>
                      <li>1008601</li>
                      <li>迪丽热巴</li>
                      <li>迪丽热巴</li>
                      <li>就诊状态</li>
                      <li>午别</li>
                      <li>2022-12-29 11:01:13</li>
                      <li>就诊状态</li>
                  </ul>-->
              </div>
          </div>
          <div id="fzTab" class="tab-item">
              <div class="tab-header">
                  <ul class="clearfix">
                      <li></li>
                      <li>序号</li>
                      <li>就诊号</li>
                      <li>姓名</li>
                      <li>医生</li>
                      <li>就诊状态</li>
                      <li>午别</li>
                      <li>报到时间</li>
                      <li>备注</li>
                  </ul>
              </div>
              <div id="fzList" class="tab-body">
                  <!--<ul class="clearfix status-0">
                      <li><input name='sel_radio' type="radio"></li>
                      <li>1</li>
                      <li>1008601</li>
                      <li>迪丽热巴</li>
                      <li>迪丽热巴</li>
                      <li>就诊状态</li>
                      <li>午别</li>
                      <li>2022-12-29 11:01:13</li>
                      <li>就诊状态</li>
                  </ul>-->
              </div>
          </div>
          <div id="yjzTab" class="tab-item">
              <div class="tab-header">
                  <ul class="clearfix">
                      <li></li>
                      <li>序号</li>
                      <li>就诊号</li>
                      <li>姓名</li>
                      <li>医生</li>
                      <li>已就诊状态</li>
                      <li>午别</li>
                      <li>报到时间</li>
                      <li>备注</li>
                  </ul>
              </div>
              <div id="yjzList" class="tab-body">
                  <!--<ul class="clearfix status-0">
                      <li><input name='sel_radio' type="radio"></li>
                      <li>1</li>
                      <li>1008601</li>
                      <li>迪丽热巴</li>
                      <li>迪丽热巴</li>
                      <li>就诊状态</li>
                      <li>午别</li>
                      <li>2022-12-29 11:01:13</li>
                      <li>就诊状态</li>
                  </ul>-->
              </div>
          </div>
          <div  id="wdbTab" class="tab-item">
              <div class="tab-header">
                  <ul class="clearfix">
                      <li></li>
                      <li>序号</li>
                      <li>就诊号</li>
                      <li>姓名</li>
                      <li>医生</li>
                      <li>午别</li>
                      <li>挂号时间</li>
                      <li>操作</li>
                  </ul>
              </div>
              <div id="wbdList" class="tab-body">
                  <!--<ul class="clearfix status-0">
                      <li><input name='sel_radio' type="radio"></li>
                      <li>1</li>
                      <li>1008601</li>
                      <li>迪丽热巴</li>
                      <li>迪丽热巴</li>
                      <li>就诊状态</li>
                      <li>午别</li>
                      <li>2022-12-29 11:01:13</li>
                      <li>就诊状态</li>
                  </ul>-->
              </div>
          </div>
      </div>
    </div>

  </div>
  <div class="d_right_tips">
    预检级别：<span class="status-1"></span><span class="status-2"></span><span class="status-3"></span>
  </div>
  <script type="text/javascript">
      $(function () {
          resetBtn();
          mouseRightMenus();
          initTabs();
          switchCall();
          greenChannelButton();
          isSwitchCalling();
          localStorage.setItem("_ISNOSPLIT_PAGE_", "N");
          var idx = GetQueryString('idx');
          if(idx&&idx=='yjz'){
              $("#nurse_tabs li:eq(2)").click();
          }else if(idx&&idx=='wbd'){
              $("#nurse_tabs li:eq(3)").click();
          }else {
              getWaitList();
          }
          $('.d_right_tips').on('click','span',function () {
              var _class = $(this).attr('class');
              var data = getCheckedPatients();
              var hospitalId = getHospitalId();
              var loginId = getLoginUserId();
              switch (_class) {
                  case 'status-3':
                      // 绿色按钮没用
                      break;
                  case "status-2":
                      // 黄色按钮只能操作 状态 1 的绿色患者
                      if(data.preteststage==3){
                          changeStatus(_yellowPipePatients,{
                              id: data.id,
                              loginId: loginId,
                              hospitalId: hospitalId
                          })
                      }
                      break;
                  case "status-1":
                      // 红色按钮可以操作状态为 2 黄色 1 绿色患者
                      if(data.preteststage==2||data.preteststage==3){
                          changeStatus(_redPipePatients,{
                              id: data.id
                          })
                      }
                      break;
              }
          })
      });
      function changeStatus(ajaxUrl,params) {
          var buttonClicked = false;
          parent&&parent.layer.confirm("确定转换？", {
              closeBtn: 0,
              btn: ['确定', '取消'],
              icon: 7
          }, function (index) {
              if (!buttonClicked) {
                  buttonClicked = true;
                  $.ajax({
                      url: ajaxUrl,
                      type: "post",
                      data: params,
                      success: function (rs) {
                          parent&&parent.layer.close(index)
                         var res = JSON.parse(rs);
                         if(res.status==0){
                             layer.msg('操作成功',{ icon: 1 });
                         }else {
                             layer.msg(res.desc, { icon: 2 });
                         }
                      },
                      error: function (jqXHR, textStatus, errorThrown) {
                          layer.alert("操作失败!", { icon: 2 });
                      },
                  });
              }
          }, function () {
              $(".btn").removeClass('on');
          });
      }
  </script>
</body>

</html>
